    package com.example.baseapp.common.enums;

    /**
     * ResponeCode enum
     *
     * @author zhangl
     * @date 2022/3/23 11:47
     */
    public enum ResponseCode {
        /**操作成功**/
        SUCCESS(200,"操作成功"),
        /**操作失败**/
        ERROR(999999,"操作失败"),
        SEQ_EXCEPTION(999998,"数据库异常"),
        METHOD_ARGUMENT_NOT_VALID_EXCEPTION(999997,"参数错误："),
        DATA_VALIDATION_FAILED(999996,"数据校验失败"),
        /**服务限流**/
        RC200(200,"操作成功"),
        /**服务降级**/
        RC201(201,"服务开启降级保护,请稍后再试!"),
        /**热点参数限流**/
        RC202(202,"热点参数限流,请稍后再试!"),
        /**系统规则不满足**/
        RC203(203,"系统规则不满足要求,请稍后再试!"),
        /**授权规则不通过**/
        RC204(204,"授权规则不通过,请稍后再试!"),
        /**access_denied**/
        RC403(403,"无访问权限,请联系管理员授予权限"),
        /**access_denied**/
        RC401(401,"匿名用户访问无权限资源时的异常"),
        /**服务异常**/
        RC500(500,"系统异常，请稍后重试"),

        INVALID_TOKEN(2001,"访问令牌不合法"),
        ACCESS_DENIED(2003,"没有权限访问该资源"),
        CLIENT_AUTHENTICATION_FAILED(1001,"客户端认证失败"),
        USERNAME_OR_PASSWORD_ERROR(1002,"用户名或密码错误"),
        UNSUPPORTED_GRANT_TYPE(1003, "不支持的认证模式"),
        DATA_EXISTS(1004,"数据已存在"),
        DATA_NOT_EXISTS(1005,"数据不存在")

        ;
        private final Integer code ;
        private final String message;

        ResponseCode(Integer code, String message) {
            this.code = code;
            this.message = message;
        }
        public Integer getCode() {
            return code;
        }

        public String getMessage() {
            return message;
        }
    }
